package com.deliccio.controller;

import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.deliccio.service.impl.LoginServiceImpl;

@Controller
@RequestMapping("/login")
public class LoginController{

	private static Logger log = Logger.getLogger(LoginController.class);
	
	@Autowired
	private LoginServiceImpl loginServiceImpl;
	
	@RequestMapping(value="/acceso",method=RequestMethod.POST)
	public @ResponseBody int acceso( String login , String pass,Model model, HttpSession session){
		log.info(" ingreso a Login con login " + login);
		
		return loginServiceImpl.buscarPersonaLogin(login,pass,session);
	}
	
	
	
}
